<?php

/**
 * @author      Nguyen Duc Thuan <me@ndthuan.com>
 * @copyright   Copyright (c) 2009 Nguyen Duc Thuan <me@ndthuan.com>
 * @version     $Id: Dictionary.php 12 2009-11-03 03:17:46Z thuan.nguyen $
 */

class Fete_Dictionary
{
    protected $_values  = array();

    /**
     *
     * @param string $name
     * @param mixed $value
     * @return Fete_Dictionary
     */
    public function &set($name, $value)
    {
        $this->_values[$name] = $value;
        return $this;
    }

    /**
     *
     * @param string $name
     * @return mixed
     */
    public function get($name)
    {
        return isset($this->_values[$name]) ? $this->_values[$name] : null;
    }

    /**
     *
     * @return array
     */
    public function getAll()
    {
        return $this->_values;
    }

    public function __set($name, $value)
    {
        $this->_values[$name] = $value;
    }

    public function __get($name)
    {
        return isset($this->_values[$name]) ? $this->_values[$name] : null;
    }
}